package com.addplus.townmall.server.web.provider.utils;

import javafx.util.Callback;

/**
 * 类名：ExcelHeader
 *
 * @author fuyongqiang
 * @version V1.0
 * @date 2018/01/19 16:14
 * @description 描述：excel标题类
 */
public class ExcelHeader implements Comparable<ExcelHeader> {

    /**
     * excel标题
     */
    private String title;

    /**
     * 排序
     */
    private Integer sort;

    /**
     * 字段名
     */
    private String fieldName;

    /**
     * 回调函数
     */
    private Callback callBack;

    public ExcelHeader() {
    }

    public ExcelHeader(String title, int sort, String fieldName) {
        super();
        this.title = title;
        this.sort = sort;
        this.fieldName = fieldName;
    }

    public ExcelHeader(String title, int sort, String fieldName, Callback callBack) {
        super();
        this.title = title;
        this.sort = sort;
        this.fieldName = fieldName;
        this.callBack = callBack;
    }

    @Override
    public int compareTo(ExcelHeader o) {
        return sort > o.sort ? 1 : (sort < o.sort ? -1 : 0);
    }

    public String getTitle() {
        return title;
    }

    public void setTitle(String title) {
        this.title = title;
    }

    public Integer getSort() {
        return sort;
    }

    public void setSort(Integer sort) {
        this.sort = sort;
    }

    public String getFieldName() {
        return fieldName;
    }

    public void setFieldName(String fieldName) {
        this.fieldName = fieldName;
    }

    public Callback getCallBack() {
        return callBack;
    }

    public void setCallBack(Callback callBack) {
        this.callBack = callBack;
    }
}
